home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
B-Business
/
(c)b2.d64
/
miniwordpro.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
3KB
|
116 lines
1000 REM MINIWORDPRO.4
1010 REM R MACNAUGHTON
1015 REM MODIFIED FOR COMMODORE-64
1017 REM BY W. M. STROME
1020 REM WEST HUMBER C I
1030 REM MARCH 1982
1035 REM REVISED FEBRUARY 1983
1040 DIM A$(25),C$(255)
1042 POKE53272,23:REM UPPER/LOWER CASE
1045 ID=8:REM INPUT 8-DISK 1-TAPE
1050 OD=8:REM OUTPUT 8-DISK 1-TAPE
1052 QC=204:QL=209:QH=210:QP=211:QQ=212:WD=40:LS=25:SC=1024
1055 N$="FILE"
1070 PRINT"[147][212]HINKING... ":GOSUB1870
1100 CU=SC+WD*2:CR=SC+WD:CX=CR+(LS-1)*WD-3:CT=CR+(LS-2)*WD
1120 CM=SC+WD*2
1130 POKEQQ,0:PRINT"\[215]RITE[146] \[211]AVE \[204]OAD \[208]RINT";:POKEQC,0
1140 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
1150 GETC$:IFC$=""THEN1150
1160 C=ASC(C$)
1170 CP=PEEK(QL)+256*PEEK(QH)+PEEK(QP):POKEQC,1:POKECP,PEEK(CP)AND127
1180 IFCP>CMTHENCM=CP:IFCM>CXTHENCM=CX
1190 IFC$="\"THEN1460
1200 IF(CAND127)>31THEN1310
1210 IF(C=13ORC=141)ANDCP<CT-WDTHENPOKEQC,1:C$=CHR$(13):GOTO1310
1220 IFC$=""THENPRINT"";:POKEQC,0:GOTO1150
1230 IFC=20ANDCP>CU THENPRINT"[157]";:GOSUB1350:POKEQC,0:GOTO1150
1240 IFC=29THEN1310
1250 IFC=157ANDCP>CU THEN1320
1260 IFC=148ANDCP<CX THENGOSUB1380:POKEQC,0:GOTO1150
1270 IFC$="[147]"THEN1410
1280 IFC$=""ANDCP<CT-2THEN1310
1290 IFC$="[145]"ANDCP>CU+WD-1THEN1320
1300 POKEQC,0:GOTO1150
1310 IFCP>CXTHENPOKEQC,0:GOTO1150
1320 PRINTC$;:POKEQC,0
1330 IFC=34THENPOKE QQ,0
1340 GOTO1150
1350 FORI=CP-1TOCM:POKEI,PEEK(I+1)
1360 NEXTI:CM=CM-1
1370 POKEI,32:RETURN
1380 FORI=CM+1TOCPSTEP-1:POKEI,PEEK(I-1)
1390 NEXTI
1400 POKECP,32:CM=CM+1:RETURN
1410 PRINT"\[195]LEAR?([217]/[206])[146]\[211]AVE \[204]OAD \[208]RINT";
1420 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
1430 GETC$:IFC$=""THEN1430
1440 IFC$<>"Y"THEN1130
1450 PRINT"[147]":GOTO1120
1460 POKEQQ,0:PRINT"\[215]RITE \[211]AVE \[204]OAD \[208]RINT";
1470 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
1480 GETCC$:IFCC$=""THEN1480
1482 IFCC$="P"THEN1790
1485 IFCC$="W"THEN1130
1490 IFCC$="S"THEN1525
1500 IFCC$="L"THEN1655
1520 GOTO1480
1525 IFID=8OROD=8THEN GOSUB6000
1530 PRINT"\[215]RITE \[211]AVE[146] \[204]OAD \[208]RINT";
1540 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
1550 LN=INT((CM-CR)/40)
1560 IFCM-CR=40THEN1130
1570 FORL=1TOLN:A$(L)=""
1580 FORM=0TOWD-1:C=CR+WD*L+M
1590 IFC>CXTHEN1610
1600 A$(L)=A$(L)+C$(PEEK(C)):POKEC,32:NEXTM,L
1610 PRINT"":IFOD=1THENOPEN3,1,1
1620 IFOD=8THENOPEN3,8,3,"@0:"+N$+",S,W"
1630 PRINT#3,LN;CHR$(13);:FORL=1TOLN:PRINT#3,A$(L);:NEXTL
1640 CLOSE3
1645 PRINT"[147]":FORL=1TOLN:PRINTA$(L);:NEXTL
1650 GOTO1460
1655 IFID=8OROD=8THEN GOSUB6000
1660 PRINT"\[215]RITE \[211]AVE \[204]OAD[146] \[208]RINT";
1670 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
1680 IFID=1THENOPEN3,1,0
1690 IFID=8THENOPEN3,8,3,"0:"+N$+",S,R"
1700 PRINT"";:INPUT#3,LN
1710 FORL=1TOLN
1720 FORM=1TOWD
1725 IFL=23ANDM>=WD-1THEN1750
1730 GET#3,C$:PRINTC$;:POKE QQ,0
1750 NEXTM,L
1760 CLOSE3
1770 CM=LN*40+CR:IFCM>CXTHENCM=CX
1780 GOTO1130
1790 PRINT"\[215]RITE \[211]AVE \[204]OAD \[208]RINT[146]";
1800 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
1810 OPEN4,4,7
1820 LN=INT(.5+(CM-CR)/40)
1830 FORL=1TOLN:PRINT#4,""TAB(20);:IFPEEK(53272)=23THENPRINT#4,"[147]";
1840 FORM=0TO39:C=CR+40*L+M
1850 PRINT#4,C$(PEEK(C));:NEXTM:PRINT#4:NEXTL:PRINT#4:PRINT#4:CLOSE4
1860 GOTO1130
1870 FORI=0TO31:C$(I)=CHR$(I+64):NEXT
1885 FORI=32TO63:C$(I)=CHR$(I):NEXT
1890 FORI=64TO95:C$(I)=CHR$(I+128):NEXT
1900 FORI=96TO127:C$(I)=CHR$(I+64):NEXT
1910 RETURN
6000 PRINT" ";
6010 PRINT"[215]HAT IS THE FILE NAME";:GOSUB60000
6020 IFLEN(IN$)=0THEN IN$=N$:PRINTN$:FORI=1TO500:NEXT
6030 N$=IN$:RETURN
60000 REM INPUT ROUTINE #1
60010 TF=20:TT=0:IN$="":PRINT"? [166][157]";
60020 GETC$:TT=TT+1:IFTT>TFTHENPRINT" [157]";
60030 IFTT>TF*2THENPRINT"[166][157]";:TT=0
60040 IFC$=""THEN60020
60050 LE=LEN(IN$)
60060 IFC$="[146]"ANDPEEK(788)=88THENPOKE788,85:GOTO60020:REM RE-ENABLE STOP KEY
60070 IF(ASC(C$)AND127)>31ANDC$<>CHR$(34)ANDLE<16THEN60110
60080 IFC$=CHR$(13)THEN IN=VAL(IN$):PRINT" ";:RETURN
60090 IFC$=CHR$(20)ANDLE>0THENIN$=LEFT$(IN$,LE-1):PRINT"[157][166] [157][157]";
60100 GOTO60020
60110 IN$=IN$+C$:PRINTC$"[166][157]";:GOTO60020